local youyi = fk.CreateSkill{
  name = "wk_heg__youyi",
}

Fk:loadTranslationTable{ 
  ["wk_heg__youyi"] = "游医",
  [":wk_heg__youyi"] = "与你势力相同角色成为黑色基本牌的目标后，你可令其展示所有手牌，弃置其中所有黑色牌并回复1点体力。",
}

local H = require "packages/ol_hegemony/util"
local HG = require "packages/new_heg_diy_my/util"

youyi:addEffect(fk.TargetConfirmed, {
  anim_type = "defensive",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(self) and H.compareKingdomWith(player, target) and data.card.color == Card.Black and data.card.type == Card.TypeBasic
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local cards = target.player_cards[Player.Hand]
    target:showCards(cards)
    room:delay(500)
    local throw = {}
    for _, id in ipairs(cards) do
      if Fk:getCardById(id).color == Card.Black then
        table.insert(throw, id)
      end
    end
    room:throwCard(throw, youyi.name, target, target)
    room:recover({
      who = target,
      num = 1,
      recoverBy = player,
      skillName = youyi.name
    })
  end,
})

return youyi